SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 66133: The LAST method might incorrectly return a nonzero return code within a DATA step that is using hash objects

DetailsHotfixAboutRate It

The LAST method might incorrectly return a nonzero return code within a DATA step that is using hash objects. The following example illustrates the problem. This program adds an item to the hash, and the LAST method should fetch that item and produce a zero return code. Instead, the item is not fetched and the LAST method returns nonzero, which indicates an error.

The circumvention is to un-comment the highlighted line of code below:

data _null_;
declare hash h(multidata:'yes');
declare hiter itr(hash:'h');
h.defineKey('k');
h.defineData('d');
h.defineDone();
k = 1;
do d = 1 to 3;
   h.add();
end; 
rc = itr.last();
put rc=;
run;
/***************************************/
/* This program adds an item to the hash and the LAST method should */
/* fetch that item and return zero. Instead, the item is not fetched */
/* and the LAST method returns nonzero, which indicates an error. */

data _null_;
   length state $ 2 city $ 32;
   dcl hash h(multidata:'y');
   h.definekey('state');
   h.definedata('city');
   h.definedone();
  /* Uncomment the next line for a workaround */
  /* if 0 then h.find_prev(); */
   state = 'NC'; city = 'Raleigh'; h.add();
   dcl hiter hi('h');
   state = ' ';
   city = ' ';
   rc = hi.last();
   put rc= state= city=;
run;

The following is the log output:

rc=160038 state= city=

Click the Hot Fix tab in this note for a link to instructions about accessing and applying the software update.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASz/OS9.4_M69.4_M79.4 TS1M69.4 TS1M7
z/OS 64-bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft® Windows® for x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 8 Enterprise 32-bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 8 Enterprise x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 8 Pro 32-bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 8 Pro x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 8.1 Enterprise 32-bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 8.1 Enterprise x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 8.1 Pro 32-bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 8.1 Pro x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows 109.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows Server 2012 Datacenter9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows Server 2012 R2 Datacenter9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows Server 2012 R2 Std9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows Server 2012 Std9.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows Server 20169.4_M69.4_M79.4 TS1M69.4 TS1M7
Microsoft Windows Server 20199.4_M69.4_M79.4 TS1M69.4 TS1M7
Windows 7 Enterprise 32 bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Windows 7 Enterprise x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Windows 7 Home Premium 32 bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Windows 7 Home Premium x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Windows 7 Professional 32 bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Windows 7 Professional x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Windows 7 Ultimate 32 bit9.4_M69.4_M79.4 TS1M69.4 TS1M7
Windows 7 Ultimate x649.4_M69.4_M79.4 TS1M69.4 TS1M7
64-bit Enabled AIX9.4_M69.4_M79.4 TS1M69.4 TS1M7
64-bit Enabled Solaris9.4_M69.4_M79.4 TS1M69.4 TS1M7
HP-UX IPF9.4_M69.4_M79.4 TS1M69.4 TS1M7
Linux for x649.4_M69.4_M79.4 TS1M69.4 TS1M7
Solaris for x649.4_M69.4_M79.4 TS1M69.4 TS1M7
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.